/* eslint-disable no-console */
/**
 * @author: SEKin
 * @Date: 2025-03-11 08:59:55
 * @description:  你不知道的 async、await 魔鬼细节
 * @Last Modified time: 2025-03-11 08:59:55
 */
async function async1() {
  console.log('1');
  await async2();
  console.log('AAA');
  window.localStorage.setItem('name', 'SEKin');
}

async function async2() {
  console.log('3');
  return new Promise((_resolve, reject) => {
    reject();
    console.log('4');
  });
}

console.log('5');

setTimeout(() => {
  console.log('6');
}, 0);

async1();

new Promise((resolve) => {
  console.log('7');
  resolve();
})
  .then(() => {
    console.log('8');
  })
  .then(() => {
    console.log('9');
  })
  .then(() => {
    console.log('10');
  });
console.log('11');
